package com.ihr360.payroll.dao;

import com.ihr360.payroll.model.dto.staff.StaffPayrollInfo;
import com.ihr360.rest.reposity.SimpleRestReposity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Set;

public interface StaffPayrollInfoRepository extends SimpleRestReposity<StaffPayrollInfo, Long> {
    @Query(value = " select s from StaffPayrollInfo s where companyId = :companyId and staff.id in (:staffIds) ")
    List<StaffPayrollInfo> findStaffPayrollinfo(@Param(value = "companyId") String companyId, @Param(value = "staffIds") Set<String> staffIds);

    StaffPayrollInfo findByCompanyIdAndStaffId(@Param(value = "companyId") String companyId, @Param(value = "staffId") String staffId);

    List<StaffPayrollInfo> findByCompanyIdAndStaffIdIn(String companyId, List<String> staffIds);
}
